<%--
  Created by IntelliJ IDEA.
  User: 28453
  Date: 2020/9/11
  Time: 10:46
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<html>
  <head>
    <title>梁山科技有限公司</title>
  </head>
  <body>
  高级查询:<br/>
  <form action="myEmpServlet" method="post" >
    姓名:<input name="ename" value=""/>
    工资:<input name="sal1" value="" />-<input name="sal2" value="" />
    性别:
    <select name="sex">
      <option value="">请选择性别</option>
      <option value="1">男</option>
      <option value="0">女</option>
    </select>
    部门:
    <select name="did">
      <option value="">请选择部门</option>
      <c:forEach items="${allDept}" var="dept">
        <option value="${dept.id}">${dept.dname}</option>
      </c:forEach>
    </select>
    <input type="submit" value="查询"/>
  </form>
  <hr>
  <table>
    <thead>
    <tr>
      <th>姓名</th>
      <th>诨名</th>
      <th>性别</th>
      <th>工资</th>
      <th>排名</th>
      <th>部门</th>
    </tr>
    </thead>
    <tbody>
    <c:forEach items="${allEmp}" var="emp">
      <tr>
        <td>${emp.ename}</td>
        <td>${emp.nickname}</td>
        <td>${emp.sex==1?"男":"女"}</td>
        <td>${emp.sal}</td>
        <td>${emp.rank}</td>
        <td>${emp.dept.dname}</td>
      </tr>
    </c:forEach>
    </tbody>
  </table>
  </body>
</html>
